package com.txy.webmanagement.utils;

import com.txy.webmanagement.model.SysUser;
import org.apache.shiro.SecurityUtils;
import org.apache.shiro.subject.Subject;

public class UserUtils {
    /**
     * subject 获取登录用户信息
     * @return
     */
    public static SysUser getLoginUser(){
        Subject sub = SecurityUtils.getSubject();
        Object obj = sub.getPrincipal();
        SysUser user=(SysUser)obj;
        return user;
    }
}
